const Router = require('koa-router');
const router = new Router({ prefix: '/api/v1/users' });
const UserController = require('../../controller/user')

router.get('/info',(ctx)=>{
    ctx.cookies.set("name","zhangs")
    ctx.body = {
        data:'用户信息',
        code:1,
        msg:"查询成功！"
    }
})

router.get('/message',(ctx)=>{
    let name  = ctx.cookies.get('name')
    ctx.body = {
        data:{
            user:name
        },
        code:1,
        msg:"查询成功！"
    }
})

router.post('/create',UserController.create)

router.get('/UserInfo',UserController.UserInfo)


module.exports = router